package ee.ut.aa.neuraltic.neural;

import java.util.ArrayList;
import java.util.List;

public class FirNetwork extends Network {

	public FirNetwork() {

		// Init in reverse so we have internal connections for free.
		OutputLayer output = new OutputLayer( null );
		// Layer hidden4 = new HiddenLayer( output );
		 Layer hidden4 = new HiddenLayer( output, 5 );
		Layer hidden3 = new HiddenLayer( hidden4, 19 );		
		Layer hidden2 = new HiddenLayer( hidden3, 83 );
		Layer hidden1 = new HiddenLayer( hidden2, 199 );
		InputLayer input = new InputLayer( hidden1 );

		List<Layer> layers = new ArrayList<Layer>();

		layers.add( input );
		layers.add( hidden1 );
		layers.add( hidden2 );
		layers.add( hidden3 );
		layers.add( hidden4 );
		// layers.add( hidden4 );
		layers.add( output );

		for( int i = 0; i < layers.size() - 1; i++ ) {

			Layer layerOne = layers.get( i );
			Layer layerTwo = layers.get( i + 1 );
			for( Neuron neuronOne : layerOne.getNeurons() ) {
				for( Neuron neuronTwo : layerTwo.getNeurons() ) {
					neuronOne.addSynaps( new Synaps( neuronTwo ) );
				}
			}
		}

		setLayers( layers );
	}
}
